<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><s:text name="context.title"/></title>
<%@ include file="/common/meta.jsp"%>
<script type="text/javascript">
	$(document).ready(function(){
		$("._button").click(function(){
			var obj = $(this);
			var fist;
			var end;
			if(obj.attr("title") == '学生选课导入'){
			//	alert("因数据量过大。。暂禁用此功能..学生的选课信息暂时直接调用教务数据");
			//	return false;
				if(!$("#chxe").validate().form()){
					return false;
				}else{
					fist = $("#fist").val();
					end = $("#end").val();
				}
			}
			if(!confirm('此过程需要比较长的时间。。确定之后，请不要刷新本页面！\n\n 确定导入？')){
				return false;
			}
			obj.attr("disabled","disabled");
			obj.val("正在导入中...");
			var methodName = $(this).attr("name");
			$.post("imp!" + methodName + ".action",{fistYear:fist,endYear:end,xq:$("#xq").val()},function(data){
					alert(data);
					obj.removeAttr("disabled");
					obj.val(obj.attr("title"));
				});
			});
		});
</script>
</head>
<body>
<br/>
<p align="center"><s:actionmessage theme="mytheme" cssClass="actionMessage"/></p>
<h1 class="title01"><img src="${ctx}/images/02_15.gif" width="45" height="42" class="fl"/>基础数据导入</h1>
<fieldset class="fs_ys" style="width: 600px">
<legend>从教务处数据库读取</legend>
<table align="center" id="contentTable" class="table_ys_input" >
<tr>
	<td>学院</td>
	<td><input type="button" class="_button" value="学院" title="学院" style="width: 70px" name="department" class="input_ys1"/></td>
</tr>
<tr>
	<td>考研室</td>
	<td><input type="button" class="_button" value="考研室" title="考研室" style="width: 70px" name="staffroom" class="input_ys1"/> </td>
</tr>
<tr>
	<td>专业</td>
	<td><input type="button" class="_button" value="专业" title="专业" style="width: 70px" name="major" class="input_ys1"/>  </td>
</tr>
<tr>
	<td>班级</td>
	<td>
		 <input type="button" class="_button" value="班级" title="班级" style="width: 70px" name="baseClass" class="input_ys1"/> 
	</td>
</tr>
<tr>
	<td>学生</td>
	<td> <input type="button" class="_button" value="学生" title="学生" style="width: 70px" name="student" class="input_ys1"/>  </td>
</tr>
<tr>
	<td>教师</td>
	<td> <input type="button" class="_button" value="教师" title="教师" style="width: 70px" name="teacher" class="input_ys1"/> </td>
</tr>
<tr>
	<td>学生选课</td>
	<td>
	<form action="" id="chxe">
		<p>学期:<input type="text" id="xq" class="input_ys1 required number" style="width: 20px"/></p>
		<p>学年：<input type="text" id="fist" class="input_ys1 Wdate required number" style="width: 40px" onfocus="var end=$dp.$('end');WdatePicker({onpicked:function(){end.focus();},maxDate:'#F{$dp.$D(\'end\')}',dateFmt:'yyyy'})"/>-<input type="text" id="end" style="width: 40px" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'fist\')}',dateFmt:'yyyy'})" class="input_ys1 Wdate required number"/></p>
		<p><input type="button" class="_button" value="学生选课导入" title="学生选课导入" style="width: 80px" name="studentTask" class="input_ys1"/></p>
		</form>
	</td>
</tr>

<tr>
	<td>教师选课</td>
	<td><input type="button" class="_button" value="教师选课" title="教师选课" style="width: 70px" name="teacherTask" class="input_ys1"/></td>
</tr>

<tr>
	<td>职称</td>
	<td> <input type="button" class="_button" value="职称" title="职称" style="width: 70px" name="post" class="input_ys1"/></td>
</tr>
</table>

</fieldset>
</body>

</html>